package com.philip;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamPanel;
import com.github.sarxos.webcam.WebcamResolution;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        try {
            BeautyEyeLNFHelper.launchBeautyEyeLNF();

            Webcam webcam = Webcam.getDefault();

            webcam.setViewSize(WebcamResolution.VGA.getSize());

            WebcamPanel panel = new WebcamPanel(webcam);

            panel.setFPSDisplayed(true);

            panel.setDisplayDebugInfo(true);

            panel.setImageSizeDisplayed(true);

            panel.setMirrored(true);

            JFrame window = new JFrame("Test webcam panel");

            window.add(panel);

            window.setResizable(true);

            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            window.pack();

            window.setVisible(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
